﻿package phpas3{
	public function microtime (get_as_float:Boolean):* {
	    // Returns either a string or a float containing the current time in seconds and microseconds
	    //
	    // version: 1109.2015
	    // discuss at: http://phpjs.org/functions/microtime
	    // +   original by: Paulo Freitas
	    // *     example 1: timeStamp = microtime(true);
	    // *     results 1: timeStamp > 1000000000 && timeStamp < 2000000000
	    var now = new Date().getTime() / 1000;
	    var s = parseInt(now, 10);

	    return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
	}
}